package com.totem.base.enums;

import lombok.Getter;

@Getter
public enum TaskCodeEnum {
    FUND_RETURN("FUND_RETURN"),
    FUND_AUTO_INVEST("FUND_AUTO_INVEST"),
    SUBSCRIBE_RETURN("SUBSCRIBE_RETURN"),
    SUBSCRIBE_CANCEL("SUBSCRIBE_CANCEL"),
    PERSONAL_INVEST("PERSONAL_INVEST"),
    TEAM_INVEST("TEAM_INVEST"),
    SUBSCRIBE_AWARD("SUBSCRIBE_AWARD");

    private String code;

    TaskCodeEnum(String code){
        this.code = code;
    }

    public static TaskCodeEnum byCode(String code) {
        for (TaskCodeEnum e: TaskCodeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
